import {
    QUERY_FAVORITES_DIR_LIST,
    ADD_FAVORITES_DIR,
    UPDATE_FAVORITES_DIR,
    DELETE_FAVORITES_DIR,
    QUERY_FAVORITES_DIR_DATA_LIST,
    QUERY_FAVORITES_DIR_Q_LIST,
} from '@/config/url';
import request from '@/utils/request';

// 获取收藏夹列表
export const favoritesDirList = (data) => {
    return request(QUERY_FAVORITES_DIR_LIST, {data});
};
// 新增收藏夹
export const addFavorites = (data) => {
    return request(ADD_FAVORITES_DIR, {method: 'post', data});
};
// 更新收藏夹
export const updateFavorites = (data) => {
    return request(UPDATE_FAVORITES_DIR, {method: 'post', data});
};
// 删除收藏夹
export const deleteFavorites = id => {
    let url = DELETE_FAVORITES_DIR.replace(/\{id\}/, id);
    return request(url, {method: 'delete'});
};

// 获取收藏夹问题列表
export const favoritesDirQList = (data) => {
    let url = QUERY_FAVORITES_DIR_Q_LIST.replace(/\{id\}/, data);
    return request(url);
};
